{% extends "base_irc.html" %}
{% load cache %}
{% load timezone_filters %}
{% block title %}DjangoBot: latest 100 | {{ channel }} logs{% endblock %}
{% block content_left %}
<div>
    <h1>latest 100 | {{ channel }}</h1>

	{% load colorme %}
	<div id="messages">
        <table>
        {% for message in messages %}
    	{% ifchanged %}
    	</table>
    	<h3><a href="{{ channel.get_absolute_url }}{{ message.logged|localtime:user_timezone|date:"Y/m/d/"}}">{{ message.logged|date:"N jS, Y" }}</a></h3>
    	<table>
    	{% endifchanged %}
            <tr valign="top" class="{% cycle highlight,normal %}">
                {% if not message.is_blocked %}
                {% if message.is_action %}
                <td class="nickname"><b>*</b></td>
                <td class="message"><b>{{ message.nickname }}</b> {{ message.text|urlizetrunc:"50" }}</td>
                {% else %}
                <td class="nickname"><span style="color: {{ message.nickname|colorize }};">{{ message.nickname }}</span></td>
                <td class="message"><div style="overflow: auto;">{{ message.text|urlizetrunc:"50" }}</div></td>
                {% endif %}
                {% else %}
                <td class="nickname"><span style="color: {{ message.nickname|colorize }};">{{ message.nickname }}</span></td>
                <td class="message"><div style="overflow: auto;">&lt; this message has been blocked. &gt;</div></td>
                {% endif %}
                <td class="time"><a href="#">{{ message.logged|localtime:user_timezone|date:"H:i" }}</a></td>
            </tr>
            {% endfor %}
        </table>
    </div>
</div>
{% endblock %}

{% block content_right %}
<div>
    {% load cal %}
    {% display_calendar for date in channel %}
    
    <h2>Top Talkers</h2>
    <ul class="graph">
        {% cache 43200 top_talkers channel %}
        {% for line in channel.top_talkers %}
        <li><span style="width: {{ line.percentage }}%;">{{ line.nickname }} ({{ line.message_count }})</span></li>
        {% endfor %}
        {% endcache %}
    </ul>
</div>
{% endblock %}